package com.xpec.c4.codec;

import java.nio.ByteBuffer;

/**
 * 编码解码接口
 * @author lipeilin
 *
 */
public interface Codec {
	
	/**
	 * 编码
	 */
	public ByteBuffer encode(Object obj) throws Exception;
	
	public byte[] encodeEx(Object obj) throws Exception;
	
	/**
	 * 解码
	 */
	public Object decode(ByteBuffer byteBuffer) throws Exception;
	
	/**
	 * 编码
	 */
	public byte[] encodeByte(Object obj) throws Exception;
	
	/**
	 * 解码
	 */
	public Object decodeByte(byte[] byteBuffer) throws Exception;

}
